package com.bmf.module.examination.controller;



import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bmf.constant.AdminResultEnum;
import com.bmf.core.result.PageResponse;
import com.bmf.module.examination.entity.SelectionStrategyQuestion;
import com.bmf.module.examination.service.SelectionStrategyQuestionService;
import com.bmf.module.examination.vo.ExaminationResultVo;
import com.bmf.module.examination.vo.SelectionStrategyQuestionCreateVo;
import com.bmf.module.examination.vo.SelectionStrategyQuestionPageVo;
import com.bmf.module.examination.vo.SelectionStrategyQuestionResultVo;
import com.bmf.module.testQuestions.vo.QuestionResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
import com.bmf.core.result.R;

/**
 * (SelectionStrategyQuestion)表控制层
 *
 * @author makejava
 * @since 2022-12-02 10:59:52
 */
@RestController
@RequestMapping("selectionStrategyQuestion")
@Api(tags = {"抽题管理试题列表接口"})
public class SelectionStrategyQuestionController{
    /**
     * 服务对象
     */
    @Autowired
    private SelectionStrategyQuestionService selectionStrategyQuestionService;

    /**
     * 分页查询所有数据
     *
     * @return 所有数据
     */
    @PostMapping("/selectAll")
    @ApiOperation(value = "分页查询试题列表")
    public R<PageResponse<SelectionStrategyQuestionResultVo>> selectAll(@RequestBody SelectionStrategyQuestionPageVo selectionStrategyQuestionPageVo) {
        return R.success(selectionStrategyQuestionService.selectAll(selectionStrategyQuestionPageVo));
    }

    /**
     * 新增数据
     *
     * @param selectionStrategyQuestionCreateVos 实体对象
     * @return 新增结果
     */
    @PostMapping
    @ApiOperation(value = "新增试题")
    public R<Void> insert(@RequestBody List<SelectionStrategyQuestionCreateVo> selectionStrategyQuestionCreateVos) {
        selectionStrategyQuestionService.insert(selectionStrategyQuestionCreateVos);
        return R.ok();
    }


    /**
     * 删除数据
     *
     * @param ids 主键结合
     * @return 删除结果
     */
    @DeleteMapping
    @ApiOperation(value = "删除试题")
    public R<Void> delete(@RequestBody List<Long> ids) {
        selectionStrategyQuestionService.delete(ids);
        return R.ok();
    }
}

